class Solution(object):
    def isPowerOfTwo(self, n):
        """
        :type n: int
        :rtype: bool
        """
        if n <= 0:
            return False

        return bin(n).count('1') == 1
        
s = Solution()
print(s.isPowerOfTwo(0)) # t
print(s.isPowerOfTwo(4)) # t